package win.demonlegion.mapper;

import win.demonlegion.module.UserBean;
import win.demonlegion.module.UserDetailBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:Samson
 * @Description:
 * @Date:Created in 2017/5/17.
 */
@Mapper
public interface UserMapper extends BaseMapper<UserBean>{

    UserBean login(@Param("phone") String phone, @Param("password")String uPwd);


    /**
     * @v2.1.0
     */
    UserBean findById(String id);



    /**
     * 个人信息修改
     * @param deail
     * @return
     */
    UserDetailBean update(UserDetailBean deail);



    UserBean read(String token);

    /**
     * 后台管理通过用户ID或手机搜索用户
     * @param keyword
     * @return
     */
    List<UserBean> selectUserByKeyword(@Param("keyword") String keyword, @Param("vaCode")int vaCode);


    /**
     * 查询手机号
     * @param phone
     * @return
     */
    UserBean selectByPhone(String phone);
}
